package com.station.client;

import com.station.client.proxies.PCoordinates;
import com.station.client.proxies.PFuelTank;

public class RefuellerCar extends SimpleCar {

    private PFuelTank tank;

    public RefuellerCar(PCoordinates coordinates, String fuelType) {
        super(coordinates, fuelType);
        //url = "imgs/refueller";
        if (fuelType.equals("A92"))
            tank = Base.getTank92();
        if (fuelType.equals("A95"))
            tank = Base.getTank95();
        if (fuelType.equals("DIESEL"))
            tank = Base.getTankDiesel();
    }

    @Override
    public boolean isProcFinished() {
        return tank.isFillUp();
    }

    @Override
    public void finishFilling(PCoordinates outPoint, PCoordinates exitPoint) {
        setPriorityTarget(outPoint);
        setTarget(exitPoint);
        setState(State.Standing);
    }
}
